package main

import (
	"bainiao/internal/game"
	"bainiao/internal/user"
	"github.com/gin-gonic/gin"
)

func main() {
	router := gin.Default()

	// 用户管理路由
userGroup := router.Group("/api/user")
{
	userGroup.POST("/register", user.Register)
	userGroup.POST("/login", user.Login)
	userGroup.POST("/wechat_login", user.WechatLogin) // 新增微信登录接口
	userGroup.POST("/add_friend", user.AddFriend)
	userGroup.GET("/info", user.GetUserInfo)
}

	// 游戏逻辑路由
	gameGroup := router.Group("/api/game")
	{
		gameGroup.POST("/cook", game.Cook)
		gameGroup.GET("/status", game.GetGameStatus)
		gameGroup.POST("/buy", game.BuyCommodityHandler) // 新增商品购买接口
	}

	router.Run(":8080")
}